package com.md.api.dao;

import com.md.api.entity.TbOrder;
import com.md.api.entity.TbOrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface TbOrderMapper {
    int deleteByOrderNo(String orderNo);

    int initOrder(TbOrder record);

    int updateOrder(TbOrder record);

    List<TbOrder> list(@Param("userId") String userId,@Param("orderStatus")  Integer orderStatus,
            @Param("orderType")  Integer orderType,@Param("payType")  Integer payType,
                       @Param("payTimeStart")  String payTimeStart,@Param("payTimeEnd")  String payTimeEnd);

    List<TbOrder> sysList(@Param("userId") String userId,@Param("orderStatus")  Integer orderStatus,
                       @Param("orderType")  Integer orderType,@Param("payType")  Integer payType,
                       @Param("payTimeStart")  String payTimeStart,@Param("payTimeEnd")  String payTimeEnd);

    TbOrder getByOrderNo(String orderNo);

    List<TbOrderDetail> orderDetail(String orderNo);

    int setSign(@Param("orderNo")String orderNo, @Param("sign")String sign);

    int distributeOrder(@Param("orderNo")String orderNo, @Param("skuId")String skuId, @Param("shippingName")String shippingName,
                        @Param("shippingCode")String shippingCode, @Param("deliveryTime")String deliveryTime);
    int confirmOrder(@Param("orderNo")String orderNo, @Param("skuId")String skuId,@Param("isConfirm")Integer isConfirm);

    int getNotConfirmOrderCount(@Param("orderNo")String orderNo);

    Integer saledCount(@Param("spuId")String spuId);
}